package com.itbaizhan.controller;

/**
 * @author spf
 * @date 2024/3/4
 * @time 9:18
 */

import com.itbaizhan.pojo.Banner;
import com.itbaizhan.result.BaseResult;
import com.itbaizhan.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 轮播图控制器API
 */
@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    /**
     * 查询轮播图
     * @return 执行结果
     */
    @GetMapping("/findPage")
    public BaseResult<List<Banner>> findPage(){
        List<Banner> banners = bannerService.getBanners();
        return BaseResult.ok(banners);
    }


}
